package net.pzc.filechooser;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

import javax.swing.table.DefaultTableModel;

public class FileItemTableModel extends DefaultTableModel {

	private static final long serialVersionUID = 1L;

	private List<Object> _rows = null;

	public FileItemTableModel(Vector<Object> cols) {
		super(cols, 0);
		this._rows = new ArrayList<Object>();
	}

	public void clear() {
		this.setRowCount(0);
		this._rows.clear();
	}

	public void addRow(IRowData rowObj) {
		_rows.add(rowObj);
		this.addRow(rowObj.getRowVector());
	}

	public Object getRow(int rowIndex) {
		return _rows.get(rowIndex);
	}

	@Override
	public boolean isCellEditable(int row, int column) {
		// if (column == 0) {
		// return false;
		// }
		// return super.isCellEditable(row, column);
		return false;
	}

}
